function [f_out,Out] = freq_domain( Fs,y,fmax)
%DISPLAY_AT_FREQ_DOMAIN Summary of this function goes here
%   Detailed explanation goes here

    Len = length(y);                     % Length of signal
    NFFT = 2^nextpow2(Len); % Next power of 2 from length of y
    if (size(y,1) ==1)
        Y = fftshift(fft(y,NFFT)/Len);
    else
        for k=1:size(y,1)
            Y(k,:) = fftshift(fft(y(k,:),NFFT)/Len);    
        end
    end

    fvec = Fs/2*linspace(-1,1,NFFT);
    Out=Y(abs(fvec)<=fmax);
    f_out=linspace(-fmax,fmax,length(Out));
end

